<template>
  <div>
    <el-button
      type="success"
      style="height: 30px; width: 50px; text-align: center"
      @click="add"
    >
      添加</el-button
    >
    <v-dialog :info="info" ref="dialog"></v-dialog>
    <v-list @edit="edit"></v-list>
  </div>
</template>


<script>
import vDialog from "./components/Dialog.vue"
import vList from "./components/List.vue"
export default {
    data(){
        return {
            info:{
                isShow:false,
                title:"",
                isAdd:false
            }
        }
    },
    methods:{
        add(){
            this.info.isShow=true;
            this.info.title="添加商品管理"
            this.info.isAdd=true;
        },
        edit(id){
            this.info.isShow=true;
            this.info.title="商品修改管理"
            this.info.isAdd=false;
            this.$refs.dialog.oneDetail(id);
        },
    },
    components:{
        vDialog,
        vList
    },
     mounted(){
       document.title=this.$route.meta.title
  }
}
</script>

<style scoped>
.el-button {
  line-height: 30px;
  margin: 10px 0px;
  padding: 0;
}

</style>